/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --brand-primary: #291f75;
  --brand-primary-hover: #1f1659;
  --brand-accent: #d92157;
  --brand-gradient: linear-gradient(135deg, #d92157 0%, #291f75 100%);

  --white: #ffffff;
  --surface: #f4f5f9;
  --surface-2: #f8f9fc;
  --ink: #0d0d1a;
  --ink-2: #4a4a6a;
  --ink-3: #66668a;
  --green: #147a4a;
  --red: #c0392b;

  --border-color: rgba(13, 13, 26, 0.08);
  --border: 1px solid var(--border-color);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(13, 13, 26, 0.05);
  --shadow-md: 0 2px 12px rgba(13, 13, 26, 0.06);
  --shadow-lg: 0 8px 32px rgba(13, 13, 26, 0.08);

  --max-width: 1400px;
  --page-pad: clamp(16px, 3vw, 40px);

  --nav-height-mobile: 68px;
  --nav-height-tablet: 76px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family:
    "Lato",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

/* Focus ring — visible for keyboard users only */
:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   Desktop header
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(16px, 2.5vw, 36px);
  background: var(--white);
  border-bottom: var(--border);
}

.brand-lockup {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}

.desktop-header-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--brand-primary);
}

.nav-item.active {
  background: rgba(41, 31, 117, 0.08);
  color: var(--brand-primary);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}

.icon-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--brand-primary);
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--brand-accent);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50px;
  border: 2px solid var(--white);
}

/* ==========================================================================
   Mobile header (hidden by default)
   ========================================================================== */
.mobile-header {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px var(--page-pad);
  background: var(--white);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-header .brand-lockup {
  flex: 1;
  min-width: 0;
}

.mobile-header .brand-label {
  font-size: 14px;
  letter-spacing: 0;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   Page title bar
   ========================================================================== */
.page-title-bar {
  background: var(--brand-gradient);
  padding: clamp(14px, 1.8vw, 18px) var(--page-pad);
}

.page-title-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.page-title-bar h1 {
  font-size: clamp(15px, 0.6vw + 12px, 17px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Page layout
   ========================================================================== */
.page-main {
  padding: clamp(16px, 2.5vw, 32px) var(--page-pad) clamp(40px, 6vw, 64px);
}

.page-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 24px);
}

/* ==========================================================================
   Policy selector
   ========================================================================== */
.policy-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.policy-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
  margin: -4px;
}

.policy-scroll::-webkit-scrollbar {
  display: none;
}

.policy-list {
  display: flex;
  gap: 10px;
  width: max-content;
}

.policy-pill {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 18px;
  border-radius: 30px;
  border: 1.5px solid var(--border-color);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.1s;
}

.policy-pill:hover {
  border-color: rgba(41, 31, 117, 0.35);
}

.policy-pill:active {
  transform: translateY(1px);
}

.policy-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

.pill-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.pill-meta {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.policy-pill.active .pill-name,
.policy-pill.active .pill-meta {
  color: var(--white);
}

.policy-pill.active .pill-meta {
  color: rgba(255, 255, 255, 0.75);
}

.nav-arrow {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: var(--border);
  background: var(--white);
  color: var(--brand-primary);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.nav-arrow:hover:not(:disabled) {
  background: var(--brand-primary);
  color: var(--white);
  border-color: var(--brand-primary);
}

.nav-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   Product card shell
   ========================================================================== */
.product-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.product-card[hidden] {
  display: none;
}

.policy-header-bar {
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px clamp(16px, 2vw, 22px);
  background: var(--surface-2);
  border-bottom: var(--border);
}

.policy-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--brand-gradient);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.policy-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.02em;
}

.policy-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.product-body {
  padding: clamp(14px, 2vw, 22px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 20px);
}

/* ==========================================================================
   Info grid — Address + Nominee / Cover Details
   ========================================================================== */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 2vw, 20px);
  align-items: start;
}

.info-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: var(--border);
}

.info-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-primary);
  min-width: 0;
}

.info-card-title i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.info-card-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--brand-primary);
  border: none;
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
}

.info-card-edit i {
  font-size: 10px;
}

.info-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   Field primitives
   ========================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.field-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
  word-break: break-word;
}

.inline-edit {
  font-size: 12px;
  color: var(--brand-accent);
  margin-left: 4px;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s;
}

.inline-edit:hover {
  opacity: 1;
}

/* ==========================================================================
   Nominee
   ========================================================================== */
.nominee-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nominee-item {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 12px 0;
}

.nominee-item:first-child {
  padding-top: 0;
}

.nominee-item:last-child {
  padding-bottom: 0;
}

.nominee-divider {
  height: 1px;
  background: var(--border-color);
  flex-shrink: 0;
}

.nominee-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
}

/* ==========================================================================
   Cover details (Dhanarashi)
   ========================================================================== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.detail-grid .full-width {
  grid-column: 1 / -1;
}

/* ==========================================================================
   Track your account — full-width below info-grid
   ========================================================================== */
.track-card .track-body {
  padding: clamp(14px, 1.8vw, 18px);
}

/* Cover cards — same look as the Swarnganga cards in billing_history/bh.html */
.tc-cover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: center;
  gap: 24px;
  align-items: start;
}

.tc-cover-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  background: var(--white);
  border: 1px solid #e4e2ed;
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 2px rgba(28, 27, 41, 0.04),
    0 4px 14px rgba(28, 27, 41, 0.06);
  padding: 20px;
}

.tc-cover-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.tc-member-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tc-member-badge--staff {
  background: rgba(41, 31, 117, 0.1);
  color: var(--brand-primary);
}
.tc-member-badge--spouse {
  background: rgba(217, 33, 87, 0.1);
  color: var(--brand-accent);
}

.tc-cover-name {
  font-size: 15px;
  font-weight: 700;
  color: #1c1b29;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tc-cover-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f4f3fb 0%, #eef0ff 100%);
}
.tc-hero-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-primary);
  opacity: 0.7;
}
.tc-hero-value {
  font-variant-numeric: tabular-nums;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1.1;
}

.tc-cover-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding-top: 14px;
  border-top: 1px solid #eeedf5;
}
.tc-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tc-stat--full {
  grid-column: 1 / -1;
}
.tc-stat-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #66668a;
}
.tc-stat-value {
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
  font-weight: 700;
  color: #4a4a6a;
  overflow-wrap: anywhere;
}

.tc-cover-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 2px;
}
@media (min-width: 480px) {
  .tc-cover-actions {
    grid-template-columns: 1.2fr 1fr;
  }
}
.tc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}
.tc-btn:hover {
  background: var(--brand-primary-hover);
}
.tc-btn:active {
  transform: translateY(1px);
}
.tc-btn i {
  transition: transform 0.15s;
}
a.tc-btn:hover i {
  transform: translateX(3px);
}

@media (max-width: 767px) {
  .tc-cover-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.1s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-primary-hover);
  color: var(--white);
}

/* ==========================================================================
   Bottom navigation
   ========================================================================== */
.bottom-nav {
  display: none;
}

/* ==========================================================================
   Responsive — mobile header switch
   ========================================================================== */
@media (max-width: 1023px) {
  .main-header {
    display: none;
  }
  .mobile-header {
    display: flex;
  }
}

/* ==========================================================================
   Responsive — selector arrows hidden below 768px
   ========================================================================== */
@media (max-width: 767px) {
  .nav-arrow {
    display: none;
  }
}

/* ==========================================================================
   Responsive — info grid stacks
   ========================================================================== */
@media (max-width: 900px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Responsive — nominee fields
   ========================================================================== */
@media (max-width: 1100px) {
  .nominee-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .nominee-fields {
    grid-template-columns: 1fr;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Responsive — bottom nav padding
   ========================================================================== */
@media (max-width: 1023px) {
  .page-main {
    padding-bottom: calc(var(--nav-height-mobile) + 32px);
  }
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height-mobile);
    background: var(--white);
    border-top: var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px env(safe-area-inset-bottom);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
  }
  .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 0;
    color: var(--brand-primary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    min-width: 0;
    transition: color 0.15s;
  }
  .bn-item:hover,
  .bn-item:focus-visible {
    color: var(--brand-primary);
  }
  .bn-icon-wrap {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .bn-icon-wrap img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
  }
}

/* Tablet: bigger bottom nav */
@media (min-width: 769px) and (max-width: 1023px) {
  .page-main {
    padding-bottom: calc(var(--nav-height-tablet) + 32px);
  }
  .bottom-nav {
    height: var(--nav-height-tablet);
    padding: 0 14px env(safe-area-inset-bottom);
  }
  .bn-item {
    font-size: 15px;
    gap: 6px;
    padding: 12px 0;
  }
  .bn-icon-wrap,
  .bn-icon-wrap img {
    width: 30px;
    height: 30px;
  }
}

/* ==========================================================================
   Responsive — mobile header tweaks
   ========================================================================== */
@media (max-width: 360px) {
  .brand-label {
    font-size: 12px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .field-label {
    font-size: 12px;
  }
  .field-value {
    font-size: 13px;
  }
  .info-card-body {
    padding: 12px 14px;
    gap: 12px;
  }
  .info-card-header {
    padding: 11px 14px;
  }
  .product-body {
    padding: 12px;
  }
  .policy-pill {
    padding: 8px 14px;
  }
  .pill-name {
    font-size: 12px;
  }
  .pill-meta {
    font-size: 12px;
  }
}

/* ==========================================================================
   Small mobile line-height safety
   ========================================================================== */
@media (max-width: 480px) {
  .member-actions {
    flex-direction: column;
  }
}

/* ==========================================================================
   Large desktop safeguard — do not let content stretch
   ========================================================================== */
@media (min-width: 1920px) {
  .page-inner,
  .page-title-inner {
    max-width: var(--max-width);
  }
}
